package com.bjpowernode.springboot.web;

import com.bjpowernode.springboot.domain.Temperature;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/temperature")
public class TemperatureController {
    Temperature t1=new Temperature("北京今天供暖，供暖时间调整","2021/11/4");
    Temperature t2=new Temperature("天津今天下雪，注意保暖","2021/11/5");
    Temperature t3=new Temperature("日本首相竞选，谁能笑到最后","2021/11/6");
    Temperature t4=new Temperature("美国参加G20，不讨人喜欢","2021/11/7");
    Temperature t5=new Temperature("冬奥会2022年，张家口积极备战","2021/11/8");




    @ApiOperation(value = "查询")
    @PostMapping("/query")
    public List<Temperature> query(){
        ArrayList<Temperature> arrayList=new ArrayList();
        arrayList.add(t1);
        arrayList.add(t2);
        arrayList.add(t3);
        arrayList.add(t4);
        arrayList.add(t5);
        return arrayList;
    }

}
